#version 430
layout(location = 0) in vec3 vPos;
layout(location = 1) in vec2 vTexcoord;
layout(location = 2) in vec3 vNormal;

out vec3 worldPos;
out vec3 worldNormal;
out vec2 texcoord;
out vec4 FragPosLightSpace;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform mat4 lightSpaceMatrix;

void main()
{
	worldPos = (model * vec4(vPos, 1.0)).xyz;
	worldNormal = mat3(transpose(inverse(model))) * vNormal;
	texcoord = vTexcoord;
	FragPosLightSpace = lightSpaceMatrix * vec4(worldPos, 1.0);
	gl_Position = projection * view * model * vec4(vPos, 1.0f);

}